package com.warrior.respository;

import com.warrior.entity.ActivityEntity;
import com.warrior.entity.TicketEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Shawn on 2017/3/15.
 */
@Repository
public interface ITicketRepository extends JpaRepository<TicketEntity,String>,PagingAndSortingRepository<TicketEntity,String> {

    /**
     *
     * @param id
     * @return
     */
    TicketEntity findTicketEntityById(String id);

    TicketEntity findTicketEntityByIdAndTicketStatus(String id,int status);

    Page<TicketEntity> findAll(Pageable page);

    Page<TicketEntity> findByTicketStatus(int status,Pageable page);

    List<TicketEntity> findTicketEntitiesByactivityByActivityId(ActivityEntity activityEntity);


}
